﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Acoris.Foundation
{
    public struct Pointer
    {
        #region operator

        public static bool operator !=(Pointer p1, Pointer p2)
        {
            return p1.X != p2.X || p1.Y != p2.Y;
        }

        public static bool operator ==(Pointer p1, Pointer p2)
        {
            return p1.X == p2.X && p1.Y == p2.Y;
        }

        public override int GetHashCode()
        {
            return X.GetHashCode() ^ Y.GetHashCode();
        }

        public override bool Equals(object obj)
        {
            if (obj is Pointer p) {
                return p.X == X && p.Y == Y;
            }
            return false;
        }

        #endregion

        public float X { get; set; }
        public float Y { get; set; }
    }
}
